package com.woniuxy.service.impl;

import com.woniuxy.entity.Stu;
import com.woniuxy.mapper.MyBatisUtil;
import com.woniuxy.mapper.StuMapper;
import com.woniuxy.service.StuService;
import org.apache.ibatis.session.SqlSession;

public class StuServiceImpl implements StuService {
    @Override
    public void addStu(Stu stu) {
        SqlSession sqlSession = MyBatisUtil.getSqlSession();
        StuMapper stuMapper = sqlSession.getMapper(StuMapper.class);
        stuMapper.insetStu(stu);
        sqlSession.commit();
        sqlSession.close();
    }
}
